# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 36
n 36(None)[w, h, interlaced, freq = real_resolution
pygui_globs['display'].set_resolution((w, h), interlaced, freq)
config.user_config[self.domain][self.key] = resolution
]:
	i: 12(), 29()
	o: 

nname: 29
n 29(None)[real_resolution = resolution
]:
	i: 0(f)
	o: 36()

nname: 12
n 12(None)[real_resolution = config.cvbs_resolution[resolution]
]:
	i: 0(t)
	o: 36()

nname: 0
n 0(resolution in COMPOSITE_OUT)[]:
	i: 
	o: 12(t), 29(f)

nname: 0
n 0(None)[if resolution in COMPOSITE_OUT:
	real_resolution = config.cvbs_resolution[resolution]
else:
	real_resolution = resolution
w, h, interlaced, freq = real_resolution
pygui_globs['display'].set_resolution((w, h), interlaced, freq)
config.user_config[self.domain][self.key] = resolution
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75d3c2c>}
nname: 98
n 98(None)[]:
	i: 83(), 97()
	o: 

nname: 97
n 97(None)[]:
	i: 0(f)
	o: 98()

nname: 83
n 83(None)[self._go_change_resolution()
]:
	i: 0(t)
	o: 98()

nname: 0
n 0(config.user_config['connections']['active_device'] == self.associated_device)[self._previous_resolution = config.user_config[self.domain][self.key]
self._new_resolution = option
super(ResolutionSetupItem, self)._select_option(option)
]:
	i: 
	o: 83(t), 97(f)

nname: 0
n 0(None)[self._previous_resolution = config.user_config[self.domain][self.key]
self._new_resolution = option
super(ResolutionSetupItem, self)._select_option(option)
if config.user_config['connections']['active_device'] == self.associated_device:
	self._go_change_resolution()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75d3fac>}
nname: 49
n 49(None)[self._set_resolution(option)
self.menu.related_menu.refresh_connection(resolution_caption)
self._confirm_new_resolution(self._previous_resolution, option)
]:
	i: 24(), 38()
	o: 

nname: 38
n 38(None)[resolution_caption = COMPOSITE_OUT[option]
]:
	i: 0(f)
	o: 49()

nname: 24
n 24(None)[resolution_caption = hdmiresolution_dict[option]
]:
	i: 0(t)
	o: 49()

nname: 0
n 0(self.associated_device == 'hdmi')[option = self._new_resolution
]:
	i: 
	o: 24(t), 38(f)

nname: 0
n 0(None)[option = self._new_resolution
if self.associated_device == 'hdmi':
	resolution_caption = hdmiresolution_dict[option]
else:
	resolution_caption = COMPOSITE_OUT[option]
self._set_resolution(option)
self.menu.related_menu.refresh_connection(resolution_caption)
self._confirm_new_resolution(self._previous_resolution, option)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75d3c8c>}
nname: 0
n 0(None)[return config.user_config.save()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb755f4cc>}
nname: 0
n 0(None)[return config.user_config.save()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb755f90c>}
nname: 0
n 0(None)[return self._discard_new_resolution(old_resolution)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb755f0ac>}
nname: 0
n 0(None)[title = _('Compatibility check')
msg = _('If you can read this page, your display resolution was successfully changed. Hit Play/Pause to confirm.')
next = Button(_('OK'))
next.connect((lambda : config.user_config.save()))
win = BigMessageWindow(msg, title, next)
win.show(timeout=20, timeout_callback=(lambda : self._discard_new_resolution(old_resolution)))
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75d3a2c>}
nname: 108
n 108(None)[self.menu.related_menu.refresh_connection(resolution_caption)
title = _('Compatibility check')
msg = _('Your display resolution has been restored to its previous setting')
BigMessageWindow(msg, title).show()
]:
	i: 83(), 97()
	o: 

nname: 97
n 97(None)[resolution_caption = COMPOSITE_OUT[old_resolution]
]:
	i: 20(f)
	o: 108()

nname: 83
n 83(None)[resolution_caption = hdmiresolution_dict[old_resolution]
]:
	i: 20(t)
	o: 108()

nname: 20
n 20(self.associated_device == 'hdmi')[super(ResolutionSetupItem, self)._select_option(old_resolution)
self._set_resolution(old_resolution)
config.user_config.save()
]:
	i: 6(), 19()
	o: 83(t), 97(f)

nname: 19
n 19(None)[]:
	i: 0(t)
	o: 20()

nname: 6
n 6(None)[old_resolution = self.fallback
]:
	i: 0(f)
	o: 20()

nname: 0
n 0(old_resolution)[]:
	i: 
	o: 6(f), 19(t)

nname: 108
n 108(None)[self.menu.related_menu.refresh_connection(resolution_caption)
title = _('Compatibility check')
msg = _('Your display resolution has been restored to its previous setting')
BigMessageWindow(msg, title).show()
]:
	i: 0()
	o: 

nname: 0
n 0(None)[if not old_resolution:
	old_resolution = self.fallback
super(ResolutionSetupItem, self)._select_option(old_resolution)
self._set_resolution(old_resolution)
config.user_config.save()
if self.associated_device == 'hdmi':
	resolution_caption = hdmiresolution_dict[old_resolution]
else:
	resolution_caption = COMPOSITE_OUT[old_resolution]
]:
	i: 
	o: 108()

nname: 0
n 0(None)[if not old_resolution:
	old_resolution = self.fallback
super(ResolutionSetupItem, self)._select_option(old_resolution)
self._set_resolution(old_resolution)
config.user_config.save()
if self.associated_device == 'hdmi':
	resolution_caption = hdmiresolution_dict[old_resolution]
else:
	resolution_caption = COMPOSITE_OUT[old_resolution]
self.menu.related_menu.refresh_connection(resolution_caption)
title = _('Compatibility check')
msg = _('Your display resolution has been restored to its previous setting')
BigMessageWindow(msg, title).show()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb755f76c>}
nname: 6
n 6(None)[__doc__ = ' Generic Resolution setup item'
depth = 2
def _set_resolution(self, resolution):
	if resolution in COMPOSITE_OUT:
		real_resolution = config.cvbs_resolution[resolution]
	else:
		real_resolution = resolution
	w, h, interlaced, freq = real_resolution
	pygui_globs['display'].set_resolution((w, h), interlaced, freq)
	config.user_config[self.domain][self.key] = resolution

def _select_option(self, option):
	self._previous_resolution = config.user_config[self.domain][self.key]
	self._new_resolution = option
	super(ResolutionSetupItem, self)._select_option(option)
	if config.user_config['connections']['active_device'] == self.associated_device:
		self._go_change_resolution()

def _go_change_resolution(self):
	option = self._new_resolution
	if self.associated_device == 'hdmi':
		resolution_caption = hdmiresolution_dict[option]
	else:
		resolution_caption = COMPOSITE_OUT[option]
	self._set_resolution(option)
	self.menu.related_menu.refresh_connection(resolution_caption)
	self._confirm_new_resolution(self._previous_resolution, option)

def _confirm_new_resolution(self, old_resolution, new_resolution):
	title = _('Compatibility check')
	msg = _('If you can read this page, your display resolution was successfully changed. Hit Play/Pause to confirm.')
	next = Button(_('OK'))
	next.connect((lambda : config.user_config.save()))
	win = BigMessageWindow(msg, title, next)
	win.show(timeout=20, timeout_callback=(lambda : self._discard_new_resolution(old_resolution)))

def _discard_new_resolution(self, old_resolution):
	if not old_resolution:
		old_resolution = self.fallback
	super(ResolutionSetupItem, self)._select_option(old_resolution)
	self._set_resolution(old_resolution)
	config.user_config.save()
	if self.associated_device == 'hdmi':
		resolution_caption = hdmiresolution_dict[old_resolution]
	else:
		resolution_caption = COMPOSITE_OUT[old_resolution]
	self.menu.related_menu.refresh_connection(resolution_caption)
	title = _('Compatibility check')
	msg = _('Your display resolution has been restored to its previous setting')
	BigMessageWindow(msg, title).show()

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb75d336c>}
nname: 163
n 163(None)[]:
	i: 24(), 57(), 117(JA), 146(JA), 154(), 162()
	o: 

nname: 162
n 162(None)[]:
	i: 65(f)
	o: 163()

nname: 154
n 154(None)[return 0
]:
	i: 125(f)
	o: 163()

nname: 146
n 146(None)[return 1
]:
	i: 125(t)
	o: 163(JA)

nname: 125
n 125(r1[1] < r2[1])[]:
	i: 96(f)
	o: 146(t), 154(f)

nname: 117
n 117(None)[return -1
]:
	i: 96(t)
	o: 163(JA)

nname: 96
n 96(r1[1] > r2[1])[]:
	i: 65(t)
	o: 117(t), 125(f)

nname: 65
n 65(abs(r1[3] - r2[3]) <= 1)[]:
	i: 32(f)
	o: 96(t), 162(f)

nname: 57
n 57(None)[return -1
]:
	i: 32(t)
	o: 163()

nname: 32
n 32(r2[3] - r1[3] > 1)[]:
	i: 0(f)
	o: 57(t), 65(f)

nname: 24
n 24(None)[return 1
]:
	i: 0(t)
	o: 163()

nname: 0
n 0(r1[3] - r2[3] > 1)[]:
	i: 
	o: 24(t), 32(f)

nname: 0
n 0(None)[if r1[3] - r2[3] > 1:
	return 1
else:
	if r2[3] - r1[3] > 1:
		return -1
	else:
		if abs(r1[3] - r2[3]) <= 1:
			if r1[1] > r2[1]:
				return -1
			else:
				if r1[1] < r2[1]:
					return 1
				else:
					return 0
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb755feac>}
nname: 0
n 0(None)[def sort_resolutions(r1, r2):
	if r1[3] - r2[3] > 1:
		return 1
	else:
		if r2[3] - r1[3] > 1:
			return -1
		else:
			if abs(r1[3] - r2[3]) <= 1:
				if r1[1] > r2[1]:
					return -1
				else:
					if r1[1] < r2[1]:
						return 1
					else:
						return 0

resolutions = hdmiresolution_dict.keys()
resolutions.sort(sort_resolutions)
ResolutionSetupItem.__init__(self, name=name, menu=menu, domain=domain, key=key, choices_list=resolutions)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75d3d4c>}
nname: 6
n 6(None)[translation_dict = hdmiresolution_dict
associated_device = 'hdmi'
fallback = (1280, 720, 0, 50)
def __init__(self, name, menu, domain, key, choices_list):
	def sort_resolutions(r1, r2):
		if r1[3] - r2[3] > 1:
			return 1
		else:
			if r2[3] - r1[3] > 1:
				return -1
			else:
				if abs(r1[3] - r2[3]) <= 1:
					if r1[1] > r2[1]:
						return -1
					else:
						if r1[1] < r2[1]:
							return 1
						else:
							return 0

	resolutions = hdmiresolution_dict.keys()
	resolutions.sort(sort_resolutions)
	ResolutionSetupItem.__init__(self, name=name, menu=menu, domain=domain, key=key, choices_list=resolutions)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb75daf0c>}
nname: 6
n 6(None)[translation_dict = COMPOSITE_OUT
associated_device = 'cvbs'
fallback = 'pal'
]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb75daecc>}
nname: 42
n 42(None)[]:
	i: 6(), 41()
	o: 

nname: 41
n 41(None)[]:
	i: 0(f)
	o: 42()

nname: 6
n 6(None)[msg = _("Warning, when you activate this option, some short black screens may be displayed at the beginning and the end of playback. Don't worry about it; your box is just switching its frame rate to guarantee you the best image!")
BigMessageWindow(msg).show(10)
]:
	i: 0(t)
	o: 42()

nname: 0
n 0(val)[]:
	i: 
	o: 6(t), 41(f)

nname: 0
n 0(None)[if val:
	msg = _("Warning, when you activate this option, some short black screens may be displayed at the beginning and the end of playback. Don't worry about it; your box is just switching its frame rate to guarantee you the best image!")
	BigMessageWindow(msg).show(10)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75d32ac>}
nname: 6
n 6(None)[__doc__ = 'Automatic Framerate adaptation setup.'
depth = 2
def execute_action(self, val):
	if val:
		msg = _("Warning, when you activate this option, some short black screens may be displayed at the beginning and the end of playback. Don't worry about it; your box is just switching its frame rate to guarantee you the best image!")
		BigMessageWindow(msg).show(10)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb75dae0c>}
nname: 45
n 45(None)[]:
	i: 24(), 44()
	o: 

nname: 44
n 44(None)[]:
	i: 0(f)
	o: 45()

nname: 24
n 24(None)[UserConfigSetupItem._select_option(self, val)
]:
	i: 0(t)
	o: 45()

nname: 0
n 0(ret)[ret = Mixer().set_hdmi_mute(val)
]:
	i: 
	o: 24(t), 44(f)

nname: 0
n 0(None)[ret = Mixer().set_hdmi_mute(val)
if ret:
	UserConfigSetupItem._select_option(self, val)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75d3c4c>}
nname: 6
n 6(None)[__doc__ = 'HDMI sound setup.'
depth = 2
translation_dict = HDMI_BOOL_OPTIONS
def _select_option(self, val):
	ret = Mixer().set_hdmi_mute(val)
	if ret:
		UserConfigSetupItem._select_option(self, val)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb75daf6c>}
nname: 6
n 6(None)[__doc__ = 'S/PDIF surround sound setup.'
depth = 2
translation_dict = SPDIF_SURROUND
]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb75daf8c>}
nname: 0
n 0(None)[from __future__ import absolute_import
import pygui.config as config
from .. import ParametersSetupItem, UserConfigSetupItem, BooleanUserConfigSetupItem
from pygui.item.core import ActionItem
from pygui.shared import pygui_globs
from pygui.window import BigMessageWindow, ConfirmWindow, Button
from pygui.facilities.codemapping import hdmiresolution_dict
from pygui.facilities.l10n import UnicodeDict
from pygui.facilities.mixer import Mix as Mixer
HDMI_BOOL_OPTIONS = UnicodeDict({False: 'ON', True: 'OFF'})
SPDIF_SURROUND = UnicodeDict({True: '5.1', False: 'Stereo'})
COMPOSITE_OUT = UnicodeDict({'pal': 'PAL', 'ntsc': 'NTSC'})
class ResolutionSetupItem(UserConfigSetupItem):
	__doc__ = ' Generic Resolution setup item'
	depth = 2
	def _set_resolution(self, resolution):
		if resolution in COMPOSITE_OUT:
			real_resolution = config.cvbs_resolution[resolution]
		else:
			real_resolution = resolution
		w, h, interlaced, freq = real_resolution
		pygui_globs['display'].set_resolution((w, h), interlaced, freq)
		config.user_config[self.domain][self.key] = resolution

	def _select_option(self, option):
		self._previous_resolution = config.user_config[self.domain][self.key]
		self._new_resolution = option
		super(ResolutionSetupItem, self)._select_option(option)
		if config.user_config['connections']['active_device'] == self.associated_device:
			self._go_change_resolution()

	def _go_change_resolution(self):
		option = self._new_resolution
		if self.associated_device == 'hdmi':
			resolution_caption = hdmiresolution_dict[option]
		else:
			resolution_caption = COMPOSITE_OUT[option]
		self._set_resolution(option)
		self.menu.related_menu.refresh_connection(resolution_caption)
		self._confirm_new_resolution(self._previous_resolution, option)

	def _confirm_new_resolution(self, old_resolution, new_resolution):
		title = _('Compatibility check')
		msg = _('If you can read this page, your display resolution was successfully changed. Hit Play/Pause to confirm.')
		next = Button(_('OK'))
		next.connect((lambda : config.user_config.save()))
		win = BigMessageWindow(msg, title, next)
		win.show(timeout=20, timeout_callback=(lambda : self._discard_new_resolution(old_resolution)))

	def _discard_new_resolution(self, old_resolution):
		if not old_resolution:
			old_resolution = self.fallback
		super(ResolutionSetupItem, self)._select_option(old_resolution)
		self._set_resolution(old_resolution)
		config.user_config.save()
		if self.associated_device == 'hdmi':
			resolution_caption = hdmiresolution_dict[old_resolution]
		else:
			resolution_caption = COMPOSITE_OUT[old_resolution]
		self.menu.related_menu.refresh_connection(resolution_caption)
		title = _('Compatibility check')
		msg = _('Your display resolution has been restored to its previous setting')
		BigMessageWindow(msg, title).show()



class HdmiOutSetupItem(ResolutionSetupItem):
	translation_dict = hdmiresolution_dict
	associated_device = 'hdmi'
	fallback = (1280, 720, 0, 50)
	def __init__(self, name, menu, domain, key, choices_list):
		def sort_resolutions(r1, r2):
			if r1[3] - r2[3] > 1:
				return 1
			else:
				if r2[3] - r1[3] > 1:
					return -1
				else:
					if abs(r1[3] - r2[3]) <= 1:
						if r1[1] > r2[1]:
							return -1
						else:
							if r1[1] < r2[1]:
								return 1
							else:
								return 0

		resolutions = hdmiresolution_dict.keys()
		resolutions.sort(sort_resolutions)
		ResolutionSetupItem.__init__(self, name=name, menu=menu, domain=domain, key=key, choices_list=resolutions)



class CompositeOutSetupItem(ResolutionSetupItem):
	translation_dict = COMPOSITE_OUT
	associated_device = 'cvbs'
	fallback = 'pal'


class AutoFrameRateSetupItem(BooleanUserConfigSetupItem):
	__doc__ = 'Automatic Framerate adaptation setup.'
	depth = 2
	def execute_action(self, val):
		if val:
			msg = _("Warning, when you activate this option, some short black screens may be displayed at the beginning and the end of playback. Don't worry about it; your box is just switching its frame rate to guarantee you the best image!")
			BigMessageWindow(msg).show(10)



class HdmiSoundSetupItem(UserConfigSetupItem):
	__doc__ = 'HDMI sound setup.'
	depth = 2
	translation_dict = HDMI_BOOL_OPTIONS
	def _select_option(self, val):
		ret = Mixer().set_hdmi_mute(val)
		if ret:
			UserConfigSetupItem._select_option(self, val)



class SpdifSurroundSetupItem(UserConfigSetupItem):
	__doc__ = 'S/PDIF surround sound setup.'
	depth = 2
	translation_dict = SPDIF_SURROUND


]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75cd66c>}
from __future__ import absolute_import
import pygui.config as config
from .. import ParametersSetupItem, UserConfigSetupItem, BooleanUserConfigSetupItem
from pygui.item.core import ActionItem
from pygui.shared import pygui_globs
from pygui.window import BigMessageWindow, ConfirmWindow, Button
from pygui.facilities.codemapping import hdmiresolution_dict
from pygui.facilities.l10n import UnicodeDict
from pygui.facilities.mixer import Mix as Mixer
HDMI_BOOL_OPTIONS = UnicodeDict({False: 'ON', True: 'OFF'})
SPDIF_SURROUND = UnicodeDict({True: '5.1', False: 'Stereo'})
COMPOSITE_OUT = UnicodeDict({'pal': 'PAL', 'ntsc': 'NTSC'})
class ResolutionSetupItem(UserConfigSetupItem):
	__doc__ = ' Generic Resolution setup item'
	depth = 2
	def _set_resolution(self, resolution):
		if resolution in COMPOSITE_OUT:
			real_resolution = config.cvbs_resolution[resolution]
		else:
			real_resolution = resolution
		w, h, interlaced, freq = real_resolution
		pygui_globs['display'].set_resolution((w, h), interlaced, freq)
		config.user_config[self.domain][self.key] = resolution

	def _select_option(self, option):
		self._previous_resolution = config.user_config[self.domain][self.key]
		self._new_resolution = option
		super(ResolutionSetupItem, self)._select_option(option)
		if config.user_config['connections']['active_device'] == self.associated_device:
			self._go_change_resolution()

	def _go_change_resolution(self):
		option = self._new_resolution
		if self.associated_device == 'hdmi':
			resolution_caption = hdmiresolution_dict[option]
		else:
			resolution_caption = COMPOSITE_OUT[option]
		self._set_resolution(option)
		self.menu.related_menu.refresh_connection(resolution_caption)
		self._confirm_new_resolution(self._previous_resolution, option)

	def _confirm_new_resolution(self, old_resolution, new_resolution):
		title = _('Compatibility check')
		msg = _('If you can read this page, your display resolution was successfully changed. Hit Play/Pause to confirm.')
		next = Button(_('OK'))
		next.connect((lambda : config.user_config.save()))
		win = BigMessageWindow(msg, title, next)
		win.show(timeout=20, timeout_callback=(lambda : self._discard_new_resolution(old_resolution)))

	def _discard_new_resolution(self, old_resolution):
		if not old_resolution:
			old_resolution = self.fallback
		super(ResolutionSetupItem, self)._select_option(old_resolution)
		self._set_resolution(old_resolution)
		config.user_config.save()
		if self.associated_device == 'hdmi':
			resolution_caption = hdmiresolution_dict[old_resolution]
		else:
			resolution_caption = COMPOSITE_OUT[old_resolution]
		self.menu.related_menu.refresh_connection(resolution_caption)
		title = _('Compatibility check')
		msg = _('Your display resolution has been restored to its previous setting')
		BigMessageWindow(msg, title).show()



class HdmiOutSetupItem(ResolutionSetupItem):
	translation_dict = hdmiresolution_dict
	associated_device = 'hdmi'
	fallback = (1280, 720, 0, 50)
	def __init__(self, name, menu, domain, key, choices_list):
		def sort_resolutions(r1, r2):
			if r1[3] - r2[3] > 1:
				return 1
			else:
				if r2[3] - r1[3] > 1:
					return -1
				else:
					if abs(r1[3] - r2[3]) <= 1:
						if r1[1] > r2[1]:
							return -1
						else:
							if r1[1] < r2[1]:
								return 1
							else:
								return 0

		resolutions = hdmiresolution_dict.keys()
		resolutions.sort(sort_resolutions)
		ResolutionSetupItem.__init__(self, name=name, menu=menu, domain=domain, key=key, choices_list=resolutions)



class CompositeOutSetupItem(ResolutionSetupItem):
	translation_dict = COMPOSITE_OUT
	associated_device = 'cvbs'
	fallback = 'pal'


class AutoFrameRateSetupItem(BooleanUserConfigSetupItem):
	__doc__ = 'Automatic Framerate adaptation setup.'
	depth = 2
	def execute_action(self, val):
		if val:
			msg = _("Warning, when you activate this option, some short black screens may be displayed at the beginning and the end of playback. Don't worry about it; your box is just switching its frame rate to guarantee you the best image!")
			BigMessageWindow(msg).show(10)



class HdmiSoundSetupItem(UserConfigSetupItem):
	__doc__ = 'HDMI sound setup.'
	depth = 2
	translation_dict = HDMI_BOOL_OPTIONS
	def _select_option(self, val):
		ret = Mixer().set_hdmi_mute(val)
		if ret:
			UserConfigSetupItem._select_option(self, val)



class SpdifSurroundSetupItem(UserConfigSetupItem):
	__doc__ = 'S/PDIF surround sound setup.'
	depth = 2
	translation_dict = SPDIF_SURROUND


